<!DOCTYPE HTML>
<html>
<head>
<!-- -------------------------------------------------------------------------------------------- -->
<!-- -------------------------------------------------------------------------------------------- -->
<!-- SETTINGS -->
<!-- -------------------------------------------------------------------------------------------- -->

<title>Bet on chope, sell your friend!</title>
<meta http-equiv="Content-Language" content="fr">
<meta http-equiv="content-type" content="text/html; charset=utf-8" >
<meta name="description" LANG="en" content="Celibax is an online betting system. It will be possible to bet on anything with your friends.
            It was initially designed to bet on which of your friends would be the first to get laid, but you can also use it for sporting events, life events or whatever you can think of!
            You cannot play real money here, the Celibax money is the Chochoro and the shame of losing!">
<meta name="robots" content="index, follow">
<meta name="Revisit-after" content="10 days">
<meta name="Date-Creation-yyyymmdd" content="20071216">
<meta name="Date-Revision-yyyymmdd" content="20110104">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="imagetoolbar" content="no">
<meta http-equiv="expires" content="never">
<meta name="viewport" content="initial-scale=0.8">

<!-- -------------------------------------------------------------------------------------------- -->
<!-- -------------------------------------------------------------------------------------------- -->
<!-- LIB INCLUDES -->
<!-- -------------------------------------------------------------------------------------------- -->
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript" src="{{ STATIC_URL}}javascript/jquery.min1.7.2.js"></script>
<script type="text/javascript" src="{{ STATIC_URL}}javascript/jquery-ui-1.9.2.custom.min.js"></script>
<script type="text/javascript" src="{{ STATIC_URL}}javascript/libs.min.js"></script>
<script type="text/javascript" src="{{ STATIC_URL}}javascript/candy.min.js"></script>
<script type="text/javascript" src="{{ STATIC_URL}}javascript/extendAjaxForCSRF.js"></script>

<!-- the following include allow internet explorer to keep the same display than the other browser -->
<!--[if lt IE 10]>
	<script type="text/javascript" src="{{ STATIC_URL}}javascript/CSS3PIE.js"></script>
<![endif]-->


<!-- -------------------------------------------------------------------------------------------- -->
<!-- -------------------------------------------------------------------------------------------- -->
<!-- STYLE AND PAGE STRUCTURE INCLUDES -->
<!-- -------------------------------------------------------------------------------------------- -->
<link rel="stylesheet" type="text/css" href="{{ STATIC_URL}}css/structure.css">
<link rel="stylesheet" type="text/css" href="{{ STATIC_URL}}css/chat.css">
<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}css/market.css" />
<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}css/contractMarket.css" />
<script language="JavaScript" type="text/javascript" src="{{ STATIC_URL}}javascript/headerStructure.js"></script>

<!-- -------------------------------------------------------------------------------------------- -->
<!-- -------------------------------------------------------------------------------------------- -->
<!--WIDGETS, GRAPHS AND CHARTS-->
<!-- -------------------------------------------------------------------------------------------- -->
<!--To keep the number of connections to the server as low as possible, we will have only one request for all the tables and charts displaid in
the website. This request will be a post request in order to avoid proxy caching. The return of this request will be a dictionnary of jsons.
the entries for those jsons will be defined in each of the include ".js" but the internal content of them will be hard coded from the python source.
We will then apply a displaying function to each of the returned json. -->
<!-- -------------------------------------------------------------------------------------------- -->
<!-- We start by including a json collector which will gather all the require informations from the following includes.
It Mostly defines the global allJsonsRegistry variable witch is a list of couple (func_name_in_py, func_name_in_js)
the meaning of this couple is define in the next comment blocks-->
<script type="text/javascript" src="{{ STATIC_URL}}javascript/allJsonsCollector.js"></script>
<!-- -------------------------------------------------------------------------------------------- -->
<!-- now we set all the json we want. each include must register into the allJsonsRegistry variable:
- The name func_name_in_py of the pyhon function it calls in the python server code to generate the json.
  This function is required to have a single argument which is the player sendind the request
- The name func_name_in_js of the  function we will apply to the returned json
  it also need to implement the function whose name is func_name_in_js-->
<script type="text/javascript" src="{{ STATIC_URL}}javascript/contractMkt.js"></script>
<!-- -------------------------------------------------------------------------------------------- -->
<!--we then call the function dispatcher which will call the function func_in_py and apply the func_in_js to the json which is returned
for all the charts/table which have been registered.-->
<script type="text/javascript" src="{{ STATIC_URL}}javascript/allJsonsDispacher.js"></script>


<!-- -------------------------------------------------------------------------------------------- -->
<!-- -------------------------------------------------------------------------------------------- -->
<!-- INITIALISATION OF THE PAGE -->
<!-- -------------------------------------------------------------------------------------------- -->
<script type="text/javascript" src="{{ STATIC_URL}}javascript/submitUtils.js"></script>
<script language="JavaScript" type="text/javascript" src="{{ STATIC_URL}}javascript/styleAndDiv.js"></script>
<script language="JavaScript" type="text/javascript" src="{{ STATIC_URL}}javascript/chatLayout.js"></script>
<script type="text/javascript" src="{{ STATIC_URL}}javascript/coreOnLoad.js"></script>
<script type="text/javascript" src="{{ STATIC_URL}}javascript/marketOnLoad.js"></script>


</head>

<body>
    {% load argTemplates %}
    {% load binaryOPerationTemplateTag %}

    <!-- create the header-->
    <script language="JavaScript" type="text/javascript">makeHeader(
        'contractMkt',
        2,
        '{{player.getName}}',
        '{{player.dbPlayer.mainStrategy.betroom.name}}',
        {{player.dbPlayer.mainStrategy.betroom.roomType}},//room type
        {{player.dbPlayer.mainStrategy.betroom.status}},
        '{{STATIC_URL}}'
     );</script>
    <noscript> <p> Activez Javascript pour voir le menu !</p></noscript>
    
    <div class="section">
        <h1>Market</h1>
    </div>
    
    <div class="section">
        <h2>Selectionner un pari</h2>
        <div align="left">Pour parier, un joueur achette et vend des contrats. Un contat est l'obligation pour le vendeur de payer 100
         chochoros &Agrave; l'acheteur si l'&eacute;v&eacute;nement sous-jacent
         s'est r&eacute;alisé &agrave; maturit&eacute;.
         </div>
	    <div align="left"> 
	    Par exemple si vous achetez un contrat pour 50 chochoros, et que l'&eacute;v&eacute;nement se r&eacute;alise vous doublez la mise.
	    <a class="help" href="#" >
            <img border="0" src="{{STATIC_URL}}images/help.png ">
            <div class="helpText myRoundCorners">
                    <h2>Commment interpréter les prix</h2>
                    <div align="left">Si un événement a 30% de chance de se réaliser, vous pourriez faire une offre d'achat ou une offre de vente à 30 chochoros.</div>
                    <div align="left">En effet vous êtes prêt à payer 30 chochoros pour un contrat qui vous rapportera 100 chochoros avec 30% de chances. 
                    Ou indifféremment recevoir 30 chochoros pour payer 100 chochoros à maturité dans 30% des cas.</div>
                    <div align="left">En pratique, vous devez prendre une marge sur ce que vous pensez être la vraie probabilité. 
                    Cela signifie vendre plus cher et acheter moins cher.</div>
                    <div align="left">Dans l'exemple précédent, vous pourriez faire une offre d'achat à 20 chochoros et une offre de vente à 40 chochoros.</div>
                    <div align="left">Plus vous êtes convaincu de ce qu'est la vraie probabilité, plus vous pouvez réduire votre marge et être plus competitif.</div>
                    <div align="left">Si vous avez vendu beaucoup plus de contrats que vous en avez achetés, vous êtes très exposé à ce que l'événement se réalise.
                    Ceci devrait vous encourager à faire des prix d'achat plus élevés.</div>
             </div>
         </a>
	    </div>
        <div id="id_SelectContract" align="left">Pick up a contract in the following list:
            <select id="id_contractDropList" name="requestedContract" class="text" onChange="requestSelectedContract();">
                <option value="addStrat" size="auto">Select a contract</option>
            </select>
        </div>
        
    </div>  
    
    <div id="id_selectedContract"></div>
    
    
    <div>
        <script language="JavaScript" type="text/javascript">footer()</script>
    </div>

</body>
</html>